package order

import (
	v1 "gitcode.com/G-YT/iHealth25/server/api/v1"
	"gitcode.com/G-YT/iHealth25/server/middleware"
	"github.com/gin-gonic/gin"
)

type OrderRouter struct{}

// InitOrderRouter 初始化 订单管理 路由信息
func (o *OrderRouter) InitOrderRouter(Router *gin.RouterGroup) {
	orderRouter := Router.Group("order").Use(middleware.OperationRecord())
	orderRouterWithoutRecord := Router.Group("order")
	var orderApi = v1.ApiGroupApp.OrderApiGroup.OrderApi
	{
		orderRouter.DELETE("deleteOrder", orderApi.DeleteOrder)           // 删除订单
		orderRouter.DELETE("batchDeleteOrder", orderApi.BatchDeleteOrder) // 批量删除订单
	}
	{
		orderRouterWithoutRecord.GET("findOrder", orderApi.FindOrder)               // 根据ID获取订单
		orderRouterWithoutRecord.GET("getOrderList", orderApi.GetOrderList)         // 获取订单列表【管理端】
		orderRouterWithoutRecord.GET("getUserOrderList", orderApi.GetUserOrderList) // 获取用户订单列表
		orderRouterWithoutRecord.POST("createPayOrder", orderApi.CreatePayOrder)    // 创建支付订单【C端】
	}
}
